/*
 *  message.h
 */

#ifndef MESSAGE_H
#define MESSAGE_H

#include <string>
#include <vector>

class Message {
public:
    Message(std::string msg);
    Message(std::string from, std::string type);
    Message(std::string from, std::string type, std::string record);
    ~Message();
    std::string getFrom();
    std::string getType();
    std::string toString();
    void addRecord(std::string record);
    void addRecord(std::string units[], int size);
    std::vector<std::string>* getRecords();
    std::vector<std::string>* getUnits(std::string record);
private:
    static const char CODE_GROUP_SEPARATOR = '\035';    //Group Separator
    static const char CODE_RECORD_SEPARATOR = '\036';   //Record Separator
    static const char CODE_UNIT_SEPARATOR = '\037';     //Unit Separator
    std::string from;
    std::string type;
    std::string body;
};

#endif  //MESSAGE_QUEUE_H

//{+}

